From 649625d707da437acdeb0c8ad3ba90d2363ae6e8 Mon Sep 17 00:00:00 2001 From: Stephen Becker IV Date: Sat, 16 May 2015 12:39:48 -0700 Subject: [PATCH] Update error message with more details. This resolves #1379. --- src/cargo/util/toml.rs | 4 ++-- tests/test_cargo_compile.rs | 2 +- tests/test_cargo_compile_custom_build.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs index 35450030e..5cbefe566 100644 --- a/src/cargo/util/toml.rs +++ b/src/cargo/util/toml.rs @@ -118,8 +118,8 @@ pub fn to_manifest(contents: &[u8], None => {} } if !manifest.targets().iter().any(|t| !t.is_custom_build()) { - return Err(human(format!("either a [lib] or [[bin]] section must \ - be present"))) + return Err(human(format!("either a [lib] (lib.rs) or [[bin]] (main.rs) section must \ + be present in src"))) } return Ok((manifest, paths)); diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 42e563855..aa18699dc 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -794,7 +794,7 @@ test!(missing_lib_and_bin { failed to parse manifest at `[..]Cargo.toml` Caused by: - either a [lib] or [[bin]] section must be present\n")); + either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src\n")); }); test!(lto_build { diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index ce2de6095..51d184330 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -953,7 +953,7 @@ test!(build_script_only { failed to parse manifest at `[..]` Caused by: - either a [lib] or [[bin]] section must be present")); + either a [lib] (lib.rs) or [[bin]] (main.rs) section must be present in src")); }); test!(shared_dep_with_a_build_script { -- 2.30.2